<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <search ref='search' :config='searchConfig' @getHeight='getHeight' @search='search' />
    <!-- table区域-begin -->
    <vxe-grid
      ref='xGrid'
      v-bind='vexConfig'
      :align='left'
      :border='true'
      :checkbox-config="checkboxConfig"
      :columns='columns'
      :data='dataSource'
      :height='pageHeight-seachHeight-94'
      :loading='loading'
      :resizable='true'
      :showOverflow='true'
      :toolbar-config="tableToolbar"
      size='mini'
      @checkbox-change='selectChangeEvent'
      @checkbox-all="selectChangeEvent"
    >
      <template  #action='{ row,rowIndex }'>
<!--        <a v-has="'getGoodsAdress:update'" @click='handleEdit(row)'>编辑</a>-->
<!--        <a-divider type='vertical' />-->
        <a-dropdown>
          <a class='ant-dropdown-link'>更多
            <a-icon type='down' />
          </a>
          <a-menu slot='overlay'>
            <a-menu-item>
              <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(row.id)">
                <a>删除</a>
              </a-popconfirm>
            </a-menu-item>
<!--            <a-menu-item v-has="'business:log'">-->
<!--              <a v-has="'business:log'" href='javascript:' @click='handleBusiness("门店管理",row)'>日志</a>-->
<!--            </a-menu-item>-->
          </a-menu>
        </a-dropdown>

      </template>
      <template #pager>
        <vxe-pager
          :currentPage.sync='ipagination.current'
          :layouts="['Total', 'PrevJump', 'PrevPage', 'Number', 'NextPage', 'NextJump','Sizes', 'FullJump']"
          :page-size.sync='ipagination.pageSize'
          :pageSizes='ipagination.pageSizeOptions'
          :total='ipagination.total'
          @page-change='handlePageChange'>
        </vxe-pager>
      </template>
    </vxe-grid>
    <!-- table区域-end -->

<!--  <div>-->
<!--    <constView ref="costView" v-if="modalDisplay" @handleButon="handleButon" v-bind="configs"></constView>-->
<!--&lt;!&ndash;    <a-button @click="change">{{ test }}</a-button>&ndash;&gt;-->
<!--    <popup ref="popupModal" @close="modalClose" v-bind="addModalData"></popup>-->
<!--  </div>-->
  </a-card>
</template>
<script>
import JSuperQuery from '@/components/cn-form/JSuperQuery.vue'
import JInput from '@/components/cn-form/JInput.vue'
import { PageListMixin } from '@/mixins/PageListMixin'
import { filterObj } from '@/utils/util'
import JTreeSelect from '@/components/cn-form/JTreeSelect'
import { postAction,getAction } from '@/api/manage'

export default {
  name: 'constBudget',
  description: '折扣费用明细',
  components: { JTreeSelect, filterObj,JInput,JSuperQuery },
  mixins: [PageListMixin],
  data() {
    return {
      // 列表主数据
      test: 0,
      modalDisplay: true,
      //搜索区域
      searchConfig: [
        {
          type: 'input',
          name: 'poolCode',
          placeholder: '请输入费用编号'
        },
        {
          type: 'input',
          placeholder: '请输入商品编号',
          name: 'productCode'
        },
        {
          type: 'input',
          placeholder: '请输入商品名称',
          name: 'productName'
        },
        {
          type: 'input',
          placeholder: '请输入经销商编号',
          name: 'custCode'
        },
        {
          type: 'input',
          placeholder: '请输入经销商名称',
          name: 'custName'
        },
      ],
      //表头
      columns: [
        {
          width:60,
          fixed: 'left',
          type:'checkbox',
        },
        {
          title: '费用凭证编号',
          minWidth:80,
          field: 'poolCode'
        },
        {
          title: '经销商名称',
          minWidth:80,
          field: 'custName'
        },
        {
          title: '经销商编号',
          minWidth:80,
          field: 'custCode',
          scopedSlots: { customRender: 'custCode' }
        },
        // {
        //   title: '费用类型',
        //   minWidth:80,
        //   field: 'type'
        // },
        {
          title: '科目编号',
          minWidth:80,
          field: 'subjectCode'
        },
        {
          title: '科目名称',
          minWidth:80,
          field: 'subjectName'
        },
        {
          title: '商品编号',
          minWidth:80,
          field: 'productCode'
        },
        {
          title: '商品名称',
          minWidth:80,
          field: 'productName'
        },
        {
          title: '费用池总额',
          minWidth:100,
          field: 'totalFee'
        },
        {
          title: '已使用金额',
          minWidth:100,
          field: 'usedFee'
        },
        {
          title: '费用池余额',
          minWidth:100,
          field: 'balance'
        },
        {
          title: '占用金额',
          minWidth:80,
          field: 'frozenFee'
        },

        {
          title: '操作',
          fixed: 'right',
          align: 'center',
          width: 150,
          slots: { default: 'action' },
        }
      ],
      url: {
        list: window._CONFIG['domianDmsURL'] + '/dmsFeePoolController/findPageList',
        detail: window._CONFIG['domianDmsURL'] + '/dmsFeePoolController/getInfo',
        delete: window._CONFIG['domianDmsURL'] + '/dmsFeePoolController/deleteById'
      },
      urlAdd: {
        addOrUpdateUrl: window._CONFIG['domianDmsURL'] + '/dmsFeePoolController/saveEntity'
      },
      rowKey: 'custCode',
    }
  },
  created() {},
  methods: {},
}
</script>
<style scoped>

</style>